home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 12
/
012.d81
/
comal #3
< prev
next >
Wrap
Text File
|
2022-08-26
|
4KB
|
239 lines
COMAL corner-Part 3 by Jimmy Weiler
THE COMAL 0.14 OPERATING SYSTEM
- - - - - - - - - - - - - - - - - -
PART THE FIRST: JUST ENOUGH TO GET BY
- - - - - - - - - - - - - - - - - -
Command: 'PASS'
Since you're going to want to save
everything you write, you're going to
need to know how COMAL handles disk
commands.
First, you need to format a disk.
We all remember the DOS NEW command:
OPEN15,8,15,"N0:MY DISK NAME,ID". In
COMAL when we pass a command to the
disk we don't need to open a channel.
We just use the "PASS" command:
PASS "N0:MY DISK NAME,ID"
There is NO difference between disks
formatted with the BASIC command or
the COMAL command. You can store both
COMAL and BASIC programs on the same
disk. Both types will appear as PRG
files, so be consistent with naming
conventions if you are going to mix
languages on one disk. Tacking ".C"
to the end of every COMAL 0.14 program
name is sufficient.
Any DOS command that you could use
in an OPEN statement in BASIC can be
PASSed by COMAL. The commands include
NEW "N0:NAME,ID"
RENAME "R0:NEWNAME=OLDNAME"
SCRATCH "S0:FILENAME"
COPY "C0:NEWFILE=0:OLDFILE"
VALIDATE "V0"
INITIALIZE "I0"
- - - - - - - - - - - - - - - - - -
Command: 'CAT'
You want to be able to see what
programs are on your COMAL disk. In
BASIC, you LOAD"$",8 and LIST it. In
COMAL, you look at the catalog (or
directory) with the CAT command. It
works much like the @$ command that
comes with the DOS wedge. (If you
don't know about the wedge, I suggest
you check out DOS & DON'TS -- we
covered the wedge in the first
installments of that series.)
Example:
CAT
0"MY DISK NAME" C1 2A
660 BLOCKS FREE
- - - - - - - - - - - - - - - - - -
Command: 'STATUS$'
When the red light is flashing on
your 1541 disk drive, that means you
had a disk error. BASIC provides no
easy way to find out what the error
was. COMAL, on the other hand, has
the STATUS$ command. At any time, you
can type STATUS$ and the disk error
status will be revealed. If the red
light was not flashing, the status
will usually be OK. STATUS$ is
equivalent to the DOS wedge @ command.
- - - - - - - - - - - - - - - - - -
'PROGRAM ENTRY'
Writing a program in COMAL is much
like writing one in BASIC. Enter the
line number followed by the
instruction. Then press RETURN. Line
numbers cannot exceed 9999.
100 PRINT "HELLO"
200 PRINT "I AM COMAL"
If you enter something wrong, COMAL
will reject your line and place the
cursor at the first error in the line.
- - - - - - - - - - - - - - - - - -
Command: 'LIST'
To view a COMAL program, you type
LIST. You can view any line or group
of lines.
LIST -- prints the whole program.
LIST 100 -- prints just line 100.
LIST 5,80 -- prints all lines from 5
through line 80.
- - - - - - - - - - - - - - - - - -
'PROGRAM EDITING'
Editing in COMAL works almost like
it does in BASIC. You can either
re-type the entire program line, or
you can list it and use the CRSR keys
and INST/DEL to edit the line on the
screen. You enter a line by pressing
RETURN. As usual for the Commodore
64, if the cursor is ANYWHERE on the
line, the whole line will be accepted.
- - - - - - - - - - - - - - - - - -
Command: 'RUN'
You can run your program in memory
at any time by entering RUN.
- - - - - - - - - - - - - - - - - -
Command: 'SAVE'
Save the program to disk with the
SAVE command. Unlike BASIC, COMAL
does not use a unit number, so
SAVE "MY PROGRAM",8 (BASIC syntax)
becomes
SAVE "MY PROGRAM" (COMAL syntax).
- - - - - - - - - - - - - - - - - -
Command: 'NEW'
NEW erases your program from memory,
just like in BASIC.
- - - - - - - - - - - - - - - - - -
Command: 'LOAD'
You reload your program from the
disk with the LOAD command.
Like SAVE, LOAD does not use a unit
number.
LOAD "MY PROGRAM" will load the
program we just told you how to SAVE.
After you load a program, you get it
started by typing RUN.
- - - - - - - - - - - - - - - - - -